#include <stdio.h>

/**
 * 第一次C语言程序设计作业
 * 实现一个简单的计算器程序
 */

int add(int a, int b) {
    return a + b;
}

int subtract(int a, int b) {
    return a - b;
}

int multiply(int a, int b) {
    return a * b;
}

float divide(int a, int b) {
    if (b == 0) {
        printf("Error: Division by zero!\n");
        return 0;
    }
    return (float)a / b;
}

int main() {
    int num1 = 10, num2 = 5;
    
    printf("Calculator Demo\n");
    printf("Number 1: %d\n", num1);
    printf("Number 2: %d\n", num2);
    
    printf("\nResults:\n");
    printf("Addition: %d\n", add(num1, num2));
    printf("Subtraction: %d\n", subtract(num1, num2));
    printf("Multiplication: %d\n", multiply(num1, num2));
    printf("Division: %.2f\n", divide(num1, num2));
    
    return 0;
} 